﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Threading.Tasks;

namespace MockNetCore
{
    public class Mock
    {
        public static async Task<object> mock(String template)
        {
            JObject jsonT = JsonConvert.DeserializeObject<JObject>(template);
            return await Task.Run(() => { return Handler.gen(jsonT, null, new Context()); });
        }

        public static async Task<object> mock(String template, Context context)
        {
            JObject jsonT = JsonConvert.DeserializeObject<JObject>(template);
            return await Task.Run(() => { return Handler.gen(jsonT, null, context); });
        }
    }
}